package com.itany.corejava.code08_常用类.枚举;

/**
 * @author MissChen
 * @version 1.0
 * @date 2023 年11月15日 15:58
 */
public enum Season {
    //第一行必须去创建实例对象，枚举中要求所有的固定内容均需要省略
    // public static final Season SPRING=new Season("春天",1,3);
    SPRING("春天",3,5),
    SUMMER("夏天",6,9),
    AUTUMN("秋天",10,12),
    WINTER("冬天",1,3),
    ALL;//如果没有参数，括号是可以省略的
    private String name;
    private int beginMonth;
    private int endMonth;

    //由于只能是私有的,因此枚举类的构造函数默认使用private进行修饰

    Season(){}
    Season(String name,int beginMonth,int endMonth){
        this.name=name;
        this.beginMonth=beginMonth;
        this.endMonth=endMonth;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getBeginMonth() {
        return beginMonth;
    }

    public void setBeginMonth(int beginMonth) {
        this.beginMonth = beginMonth;
    }

    public int getEndMonth() {
        return endMonth;
    }

    public void setEndMonth(int endMonth) {
        this.endMonth = endMonth;
    }
}
